feat: add FunASR speech recognition backend#10090
Conversation
|
Hi @mudler, friendly ping — this PR adds FunASR as a speech recognition backend for LocalAI. Ready for review whenever convenient. Thanks! |
|
Hi @mudler, friendly follow-up — this PR adds FunASR as a speech recognition backend for LocalAI. FunASR recently added an agent-friendly CLI ( |
c2ddbf3 to
74c6596
Compare
|
Rebased onto the latest |
fd9fd5f to
8105d38
Compare
|
Rebased this PR onto the latest Current state:
Local checks run: ruby -e 'require "yaml"; data=YAML.load_file("backend/index.yaml"); names=data.select { |x| x.is_a?(Hash) }.map { |x| x["name"] }; abort("missing funasr") unless names.include?("funasr"); abort("missing cpu-funasr") unless names.include?("cpu-funasr"); abort("missing metal-supertonic") unless names.include?("metal-supertonic"); puts "index ok: #{data.length} entries"'
python3 -m py_compile backend/python/funasr/backend.py
rg -n "<<<<<<<|=======|>>>>>>>" backend/index.yaml backend/python/funasr || true
git diff --check upstream/master...HEAD |
|
Quick maintainer-side validation pass after the latest rebase:
I did not run a full dependency install or model transcription in this bare ops environment, but the registry wiring and backend entrypoint syntax look clean from this pass. |
|
One caveat from a deeper pass so the validation note above is not read as a ready-to-merge sign-off: So the registry wiring, syntax, and requirement-file checks are clean, but the |
|
Follow-up on the test caveat I noted earlier: I pushed signed head What it covers without downloading FunASR weights:
Validation on the refreshed branch: Note: running |
cdcdf52 to
f258f5f
Compare
Signed-off-by: zhifu gao <zhifu.gzf@alibaba-inc.com>
Signed-off-by: LauraGPT <LauraGPT@users.noreply.github.com>
f258f5f to
bc41281
Compare
|
Rebased this PR onto current Current head is Validation run locally on the rebased branch:
GitHub DCO is passing on the new head. |
|
I pulled the failing fork-side The job reaches the CodeQL/code-scanning upload step and fails because the fork token cannot access the CodeQL API endpoints: So the visible failing For the FunASR backend itself, the latest local validation remains: |
Signed-off-by: LauraGPT <LauraGPT@users.noreply.github.com>
|
Pushed signed head This update fixes three runtime gaps found during that pass:
Verification on
The PR description now contains the complete reproducible verification summary. Ready for review. Follow-up for signed head b970f89:
The upstream DCO check is green. The other eight workflows currently show action_required with zero jobs, so there is no failing log to address from the contributor side. @mudler, could you approve those workflow runs and review the backend when convenient? |
Signed-off-by: LauraGPT <LauraGPT@users.noreply.github.com>
Signed-off-by: LauraGPT <LauraGPT@users.noreply.github.com>
|
@mudler, could you take a look at this FunASR backend when convenient? The branch is current with master and DCO passes. I have now exercised the actual LocalAI install, unit-test helper, CPU and CUDA SenseVoice inference, and gRPC LoadModel/AudioTranscription paths; all returned clean OpenAI-compatible text, and the six focused tests pass. There are no remaining code-owned CI failures on the PR head. Exact-head update for
|
Signed-off-by: LauraGPT <LauraGPT@users.noreply.github.com>
Summary
Adds FunASR as a speech recognition backend for LocalAI.
FunASR is an industrial-grade ASR toolkit from Alibaba DAMO Academy, featuring:
Changes
backend/python/funasr/torchaudioalongside every explicitly installed Torch profileUsage
The backend supports the standard
/v1/audio/transcriptionsendpoint with an optionallanguageparameter.Verification
install.shpath on Python 3.12 / CUDA 12bash test.shpy_compile,bash -n, Ruff, andgit diff --checkLoadModelandAudioTranscriptionsucceeded throughBackendStub我现在在录一段测试音频The verification used a local snapshot of the official
FunAudioLLM/SenseVoiceSmallweights to keep repeated runs deterministic; the defaultiic/SenseVoiceSmallmodel identifier remains unchanged.